|
|
|
|
|
|
|
Examples Filename: Employee.frm |
|
|
|
|
|
|
|
|
In the Save command button, youll find code that grabs the data from the form and puts it in a module-level variable thats declared as Employee_Type. All youre going to do right now is to put the data in and then display some of the data back from the user-defined type variable. Although this is not a real useful example, it does show you the syntax you use when working with a user-defined type: |
|
|
|
 |
|
|
|
|
Private Sub cmdSave_Click()
mtypEmp.strFirst = txtFirst.Text
mtypEmp.strLast = txtLast.Text
mtypEmp.strStreet = txtAddress.Text
mtypEmp.strCity = txtCity.Text
mtypEmp.strState = cboState.Text
mtypEmp.strZip = txtZip.Text
mtypEmp.strSSN = txtSSN.Text
mtypEmp.boolBonus = chkBonus.Value
MsgBox "Name = " & mtypEmp.strLast & _
", " & mtypEmp.strFirst
End Sub |
|
|
|
|
|
|
|
|
Figure 7.3
User-defined type example. |
|
|
|
|
|